#include <cstdio>
#include <ctime>
#include <exception>
#include <fmt/format.h>
#include <iostream>
#include <iterator>
#include <source_location>
#include <stdexcept>
#include <string>
#include <vector>
using namespace std;

template <typename Iter>
auto myFind(Iter begin, Iter end,
            const typename iterator_traits<Iter>::value_type &value) {
  for (auto iter{begin}; iter != end; ++iter) {
    if (*iter == value) {
      return iter;
    }
  }
  return end;
}
int main() {
  std::vector values{11, 22, 33, 44};
  auto result = myFind(cbegin(values), cend(values), 22);
  if (result != cend(values)) {
    cout << fmt::format("found values at position {}\n",
                        distance(cbegin(values), result));
  }
}